/**
 * 
 */
package com.zte.claa.inficombo.csa.app.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author 0283000115
 * 
	csa.hcgnsssvr.comm.needstart=N
	csa.hcgnsssvr.comm.svrip=localhost
	csa.hcgnsssvr.comm.port=43012
	csa.hcgnsssvr.comm.bufsize=10240
	csa.hcgnsssvr.comm.cmdsendtimeoutsecond=5
	csa.hcgnsssvr.comm.cmdtimeoutsecond=20
	csa.hcgnsssvr.comm.connwaitsecond=15
	csa.hcgnsssvr.comm.sessionidlesecond=60
	csa.hcgnsssvr.comm.charsetname=UTF-8
	csa.hcgnsssvr.comm.returnrspdata=N
	csa.hcgnsssvr.comm.returnrspthreshold=1536
	csa.hcgnsssvr.comm.queuemaxsize=5000
	csa.hcgnsssvr.comm.processornum=1
	csa.hcgnsssvr.comm.devtype=huace_gnss
	
	csa.hcgnsssvr.comm.localRecvPort=16378
	csa.hcgnsssvr.comm.localRecvBufsize=4096
 *
 */

@Component  
@ConfigurationProperties(prefix="csa.hcgnsssvr.comm") 
public class HCGNSSSvrCommProps {
	public static final String NEED_START_NO = "N";
	public static final String NEED_START_YES = "Y";
	
	private String needstart = "N";
	private String svrip = "127.0.0.1";
	private int port = 14257;	
	private int bufsize = 4096;
	private int cmdsendtimeoutsecond=5;
	private int connwaitsecond = 7;
	private int cmdtimeoutsecond = 10;
	private int sessionidlesecond = 90;
	private String charsetname = "UTF-8";
	private String returnrspdata = "N";
	private int returnrspthreshold = 1536;
	private int queuemaxsize = 5000;	
	private int processornum = 1;
	private String devtype = "huace_gnss";	
	
	private int localRecvPort=6376;
	private int localRecvBufsize=4096;
	
	/**
	 * @return the svrip
	 */
	public String getSvrip() {
		return svrip;
	}
	
	/**
	 * @param svrip the svrip to set
	 */
	public void setSvrip(String svrip) {
		this.svrip = svrip;
	}
	
	public String getNeedstart() {
		return needstart;
	}

	public void setNeedstart(String needstart) {
		this.needstart = needstart;
	}

	/**
	 * @return the port
	 */
	public int getPort() {
		return port;
	}
	
	/**
	 * @param port the port to set
	 */
	public void setPort(int port) {
		this.port = port;
	}

	/**
	 * @return the charsetname
	 */
	public String getCharsetname() {
		return charsetname;
	}
	
	/**
	 * @param charsetname the charsetname to set
	 */
	public void setCharsetname(String charsetname) {
		this.charsetname = charsetname;
	}

	/**
	 * @return the bufsize
	 */
	public int getBufsize() {
		return bufsize;
	}

	/**
	 * @param bufsize the bufsize to set
	 */
	public void setBufsize(int bufsize) {
		this.bufsize = bufsize;
	}

	/**
	 * @return the connwaitsecond
	 */
	public int getConnwaitsecond() {
		return connwaitsecond;
	}

	/**
	 * @param connwaitsecond the connwaitsecond to set
	 */
	public void setConnwaitsecond(int connwaitsecond) {
		this.connwaitsecond = connwaitsecond;
	}

	/**
	 * @return the cmdtimeoutsecond
	 */
	public int getCmdtimeoutsecond() {
		return cmdtimeoutsecond;
	}

	/**
	 * @param cmdtimeoutsecond the cmdtimeoutsecond to set
	 */
	public void setCmdtimeoutsecond(int cmdtimeoutsecond) {
		this.cmdtimeoutsecond = cmdtimeoutsecond;
	}

	/**
	 * @return the sessionidlesecond
	 */
	public int getSessionidlesecond() {
		return sessionidlesecond;
	}

	/**
	 * @param sessionidlesecond the sessionidlesecond to set
	 */
	public void setSessionidlesecond(int sessionidlesecond) {
		this.sessionidlesecond = sessionidlesecond;
	}

	/**
	 * @return the cmdsendtimeoutsecond
	 */
	public int getCmdsendtimeoutsecond() {
		return cmdsendtimeoutsecond;
	}

	/**
	 * @param cmdsendtimeoutsecond the cmdsendtimeoutsecond to set
	 */
	public void setCmdsendtimeoutsecond(int cmdsendtimeoutsecond) {
		this.cmdsendtimeoutsecond = cmdsendtimeoutsecond;
	}

	public String getReturnrspdata() {
		return returnrspdata;
	}

	public void setReturnrspdata(String returnrspdata) {
		this.returnrspdata = returnrspdata;
	}

	public int getReturnrspthreshold() {
		return returnrspthreshold;
	}

	public void setReturnrspthreshold(int returnrspthreshold) {
		this.returnrspthreshold = returnrspthreshold;
	}

	public int getProcessornum() {
		return processornum;
	}

	public void setProcessornum(int processornum) {
		this.processornum = processornum;
	}
	
	public String getDevtype() {
		return devtype;
	}

	public void setDevtype(String devtype) {
		this.devtype = devtype;
	}

	public int getQueuemaxsize() {
		return queuemaxsize;
	}

	public void setQueuemaxsize(int queuemaxsize) {
		this.queuemaxsize = queuemaxsize;
	}

	public int getLocalRecvPort() {
		return localRecvPort;
	}

	public void setLocalRecvPort(int localRecvPort) {
		this.localRecvPort = localRecvPort;
	}

	public int getLocalRecvBufsize() {
		return localRecvBufsize;
	}

	public void setLocalRecvBufsize(int localRecvBufsize) {
		this.localRecvBufsize = localRecvBufsize;
	}

	public HCGNSSSvrCommProps clone(){
		HCGNSSSvrCommProps p = new HCGNSSSvrCommProps();
		p.setNeedstart(this.needstart);
		p.setSvrip(this.svrip);
		p.setPort(this.port);
		p.setBufsize(bufsize);
		p.setCmdsendtimeoutsecond(cmdsendtimeoutsecond);
		p.setConnwaitsecond(connwaitsecond);
		p.setCmdsendtimeoutsecond(cmdsendtimeoutsecond);
		p.setSessionidlesecond(sessionidlesecond);
		p.setCharsetname(charsetname);
		p.setReturnrspdata(returnrspdata);
		p.setReturnrspthreshold(returnrspthreshold);
		p.setProcessornum(processornum);
		p.setQueuemaxsize(queuemaxsize);
		p.setDevtype(devtype);
		p.setLocalRecvBufsize(localRecvBufsize);
		p.setLocalRecvPort(localRecvPort);
		return p;
	}
}
